#include "qlifegraphicsitem.h"

#include "qlife.h"

QLifeGraphicsItem::QLifeGraphicsItem ( QLife* life ) : QGraphicsItem()
{
	this -> life = life;

	this -> pen = QColor ( 0, 0, 0 );
	this -> drawViewDistance = false;
	this -> drawDestination = false;

	rect.setX ( 0 );
	rect.setY ( 0 );
	rect.setWidth ( 0 );
	rect.setHeight ( 0 );

	setFlag ( QGraphicsItem::ItemIsSelectable, true );
}


QLifeGraphicsItem::~QLifeGraphicsItem()
{}

void QLifeGraphicsItem::setDrawViewDistance ( bool drawViewDistance )
{
	this -> drawViewDistance = drawViewDistance;
}

void QLifeGraphicsItem::setDrawDestination ( bool drawDestination )
{
	this -> drawDestination = drawDestination;
}

QLife* QLifeGraphicsItem::getLife()
{
	return life;
}

QRectF QLifeGraphicsItem::boundingRect() const
{
	return rect;
}

void QLifeGraphicsItem::setPen ( const QPen & pen )
{
	this -> pen = pen;
}

void QLifeGraphicsItem::setBrush ( const QBrush & brush )
{
	this -> brush = brush;
}
